System and method for multi-tenancy enablement of enterprise JAVA (TM) applications using resource proxies and application tenancy context

ABSTRACT

In accordance with an embodiment, described herein is a system and method for multi-tenancy enablement of enterprise Java™ applications using resource proxies and application tenancy context. In according with an embodiment, the system and method can provide a plurality of deployable resources which can be used within the application server environment, and one or more application deployments, wherein each application deployment includes at least one of tenant-specific code and shared-tenant code. The system and method can further determine an application tenancy context of a thread, and point to one or more resource proxies, each of the one or more resource proxies being configurable to communicate with a tenant specific resource. Each of the one or more resource proxies can use the application tenancy context of a thread to communicate with a tenant specific resource.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of priority to U.S. Provisional Application titled “SYSTEM AND METHOD FOR MULTI-TENANCY ENABLEMENT OF ENTERPRISE JAVA APPLICATIONS USING RESOURCE PROXIES AND APPLICATION TENANCY CONTEXT”, Application No. 62/055,912, filed Sep. 26, 2014; and is related to U.S. Patent Application titled “SYSTEM AND METHOD FOR SUPPORTING MULTI-TENANCY IN AN APPLICATION SERVER, CLOUD, OR OTHER ENVIRONMENT”, application Ser. No. 14/601,883, filed Jan. 21, 2015; which application is herein incorporated by reference.

COPYRIGHT NOTICE

A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever.

FIELD OF INVENTION

Embodiments of the invention are generally related to application servers and cloud environments, and are particularly related to a system and method for use of resource proxies in an application server environment.

BACKGROUND

Application servers generally provide a managed environment within which software applications can be deployed and run. Cloud-based environments allow applications to run within and take advantage of the distributed resources provided by a cloud. Such environments can support large numbers of users or tenants, which can lead to redundancy in code when multiple tenants utilize the same applications.

SUMMARY

In accordance with an embodiment, described herein is a system and method for multi-tenancy enablement of enterprise Java™ applications using resource proxies and application tenancy context. In according with an embodiment, the system and method can provide a plurality of deployable resources which can be used within the application server environment, and one or more application deployments, wherein each application deployment includes at least one of tenant-specific code and shared-tenant code. The system and method can further determine an application tenancy context of a thread, and point to one or more resource proxies, each of the one or more resource proxies being configurable to communicate with a tenant specific resource. Each of the one or more resource proxies can use the application tenancy context of a thread to communicate with a tenant specific resource.

In accordance with an embodiment, described herein is a system and method for multi-tenancy enablement of enterprise Java™ applications using resource proxies and application tenancy context. In accordance with an embodiment, the system makes it possible to realize a shared tenant runtime by allowing a single Java™ EE application instance to serve multiple tenants. It also supports tenant scoped runtimes to support tenant specific customizations by allowing separate instantiation of tenant specific customizations to application logic. A shared Java™ EE application instance accesses external resources using resource proxies. The resource proxies can be configured by the deployer to communicate with a shared resource or a tenant specific resource. The use of resource proxies is completely transparent to the shared Java™ EE application instance. In situations where inter-tenant isolation needs are more important than benefits gained out of sharing, this technique allows a SaaS provider to instantiate the entire application separately for a tenant, and configure the application to use tenant specific resources directly. In accordance with an embodiment, resource proxies use the application tenancy context of the thread to communicate with a tenant specific resource. Actual resources can be configured, managed, and monitored on a per-tenant basis. The resource proxy technique works well for a variety of resources such as JMS, JDBC, and Web Services; and allows underlying resources to participate in XA transactions in case of server failure.

BRIEF DESCRIPTION OF THE FIGURES

FIG. 1 illustrates a system for supporting multi-tenancy in an application server, cloud, or other environment, in accordance with an embodiment.

FIG. 2 further illustrates a system for supporting multi-tenancy in an application server, cloud, or other environment, in accordance with an embodiment.

FIG. 3 further illustrates a system for supporting multi-tenancy in an application server, cloud, or other environment, in accordance with an embodiment.

FIG. 4 illustrates a domain configuration for use with an exemplary multi-tenant environment, in accordance with an embodiment.

FIG. 5 further illustrates an exemplary multi-tenant environment, in accordance with an embodiment.

FIG. 6 illustrates a system that supports partition-unaware and partition-aware components, in accordance with an embodiment.

FIG. 7A illustrates a block diagram depicting a runtime environment, according to an embodiment.

FIG. 7B is a block diagram depicting a runtime environment, according to an embodiment.

FIG. 7C is a block diagram depicting a runtime environment, according to an embodiment.

FIG. 8 is a block diagram which depicts a runtime view of a server where a multi-tenant application has been deployed, according to an embodiment

FIG. 9 is a block diagram which depicts a runtime view of a server where a multi-tenant application has been deployed, according to an embodiment.

FIG. 10 is a flow chart for depicting an exemplary method for deployment of a multi-tenant application, according to an embodiment.

DETAILED DESCRIPTION

In accordance with an embodiment, described herein is a system and method for multi-tenancy enablement of enterprise Java™ applications using resource proxies and application tenancy context. In according with an embodiment, the system and method can provide a plurality of deployable resources which can be used within the application server environment, and one or more application deployments, wherein each application deployment includes at least one of tenant-specific code and shared-tenant code. The system and method can further determine an application tenancy context of a thread, and point to one or more resource proxies, each of the one or more resource proxies being configurable to communicate with a tenant specific resource. Each of the one or more resource proxies can use the application tenancy context of a thread to communicate with a tenant specific resource.

Application Server (e.g., Multi-Tenant, MT) Environment

FIG. 1 illustrates a system for supporting multi-tenancy in an application server, cloud, or other environment, in accordance with an embodiment.

As illustrated in FIG. 1, in accordance with an embodiment, an application server (e.g., multi-tenant, MT) environment 100, or other computing environment which enables the deployment and execution of software applications, can be configured to include and operate according to a domain 102 configuration that is used at runtime to define an application server domain.

In accordance with an embodiment, the application server can include one or more partitions 104 that are defined for use at runtime. Each partition can be associated with a globally unique partition identifier (ID) and partition configuration, and can further include one or more resource groups 124, together with a reference to a resource group template 126 and/or partition-specific applications or resources 128. Domain-level resource groups, applications and/or resources 140 can also be defined at the domain level, optionally with a reference to a resource group template.

Each resource group template 160 can define one or more applications A 162, B 164, resources A 166, B 168, and/or other deployable applications or resources 170, and can be referenced by a resource group. For example, as illustrated in FIG. 1, resource group 124 in partition 104 can reference 190 resource group template 160.

Generally, a system administrator can define partitions, domain-level resource groups and resource group templates, and security realms; while a partition administrator can define aspects of their own partition, for example, by creating partition-level resource groups, deploying applications to the partition, or referencing specific realms for the partition.

FIG. 2 further illustrates a system for supporting multi-tenancy in an application server, cloud, or other environment, in accordance with an embodiment.

As illustrated in FIG. 2, in accordance with an embodiment, a partition 202 can include, for example, a resource group 205 which includes a reference 206 to a resource group template 210, a virtual target (e.g., virtual host) information 207, and a pluggable database (PDB), or other data source, information 208. A resource group template (e.g., 210) can define, for example, a plurality of applications A 211 and B 212, together with resources such as a Java™ Message Server (JMS) server 213, store-and-forward (SAF) agent 215, mail session component 216, or Java™ Database Connectivity (JDBC) resource 217.

The resource group template illustrated in FIG. 2 is provided by way of example; in accordance with other embodiments, different types of resource group templates and elements can be provided.

In accordance with an embodiment, when a resource group within a partition (e.g., 202) references 220 a particular resource group template (e.g., 210), information associated with a particular partition can be used in combination with the referenced resource group template, to indicate a partition-specific information 230, for example a partition-specific PDB information. The partition-specific information can then be used by the application server to configure resources, for example a PDB resource, for use by the partition. For example, partition-specific PDB information associated with partition 202 can be used, by the application server, to configure 232 a container database (CDB) 236 with an appropriate PDB 238, or other data source, for use by that partition.

Similarly, in accordance with an embodiment, a virtual target information associated with a particular partition can be used to define 239 a partition-specific virtual target 240, for use by the partition, e.g., baylandurgentcare.com, which can then be made accessible via a uniform resource locator (URL), e.g., http://baylandurgentcare.com.

FIG. 3 further illustrates a system for supporting multi-tenancy in an application server, cloud, or other environment, in accordance with an embodiment.

In accordance with an embodiment, a system configuration such as a config.xml configuration file, is used to define a partition, including configuration elements for resource groups associated with that partition, and/or other partition properties. Values can be specified per-partition using property name/value pairs.

In accordance with an embodiment, a plurality of partitions can be executed within a managed server/cluster 242, or a similar environment which can provide access to a CDB 243, and which are accessible via a web tier 244. This allows, for example, a domain or partition to be associated with one or more of the PDBs (of the CDB).

In accordance with an embodiment, each of the plurality of partitions, in this example partition A 250 and partition B 260, can be configured to include a plurality of resources associated with that partition. For example, partition A can be configured to include a resource group 251 which contains an application A1 252, application A2 254, and JMS A 256, together with a datasource A 257 associated with PDB A 259, wherein the partition is accessible via a virtual target A 258. Similarly, partition B 260 can be configured to include a resource group 261 which contains an application B1 262, application B2 264, and JMS B 266, together with a datasource B 267 associated with PDB B 269, wherein the partition is accessible via a virtual target B 268.

While several of the above examples illustrate use of CDB and PDBs, in accordance with other embodiments, other types of multi-tenant or non-multi-tenant databases can be supported, wherein a particular configuration can be provided for each partition, for example through the use of schemas, or the use of different databases.

Resources

In accordance with an embodiment, a resource is a system resource, application, or other resource or object that can be deployed to a domain of the environment. For example, in accordance with an embodiment, a resource can be an application, JMS, JDBC, JavaMail, WLDF, data source, or other system resource or other type of object that can be deployed to a server, cluster, or other application server target.

Partitions

In accordance with an embodiment, a partition is a runtime and administrative subdivision or slice of a domain that can be associated with a partition identifier (ID) and configuration, and can contain applications and/or refer to domain-wide resources through the use of resource groups and resource group templates.

Generally, a partition can contain its own applications, refer to domain wide applications via resource group templates, and have its own configuration. Partitionable entities can include resources, for example JMS, JDBC, JavaMail, WLDF resources, and other components, such as JNDI namespace, network traffic, work managers, and security policies and realms. In the context of a multi-tenant environment, the system can be configured to provide tenant access to the administrative and runtime aspects of partitions associated with a tenant.

In accordance with an embodiment, each resource group within a partition can optionally reference a resource group template. A partition can have multiple resource groups, and each of them can reference a resource group template. Each partition can define properties for configuration data that is not specified in the resource group templates to which the partition's resource groups refer. This enables the partition to act as a binding of deployable resources defined in a resource group template, to specific values for use with that partition. In some cases, a partition can override configuration information specified by a resource group template.

In accordance with an embodiment, a partition configuration, as defined for example by a config.xml configuration file, can include a plurality of configuration elements, for example: “partition”, which contains the attributes and child elements that define the partition; “resource-group”, which contains the applications and resources deployed to the partition; “resource-group-template”, which contains applications and resources defined by that template; “jdbc-system-resource-override”, which contains a database-specific service name, user name, and password; and “partition-properties”, which contains property key values that can be used for macro replacement in resource group templates.

Upon startup, the system can use the information provided by the configuration file to generate partition-specific configuration elements for each resource, from the resource group template.

Resource Groups

In accordance with an embodiment, a resource group is a named, fully-qualified collection of deployable resources that can be defined either at a domain or partition level, and can reference a resource group template. The resources in a resource group are considered fully-qualified in that the administrator has provided all of the information needed to start or connect to those resources, for example the credentials for connecting to a data source, or the targeting information for an application.

A system administrator can declare resource groups at the domain level, or at the partition level. At the domain level, a resource group provides a convenient way to group related resources. The system can manage resources declared in a domain-level resource group the same as ungrouped resources, so that the resources can be started during system start-up, and stopped during system shut-down. An administrator can also stop, start, or remove a resource in a group individually, and can act on all the resources in a group implicitly by operating on the group. For example, stopping a resource group stops all of the resources in the group that are not already stopped; starting the resource group starts any resources in the group that are not already started; and removing the resource group removes all of the resources contained in the group.

At the partition level, a system or partition administrator can configure zero or more resource groups in a partition, subject to any security restrictions. For example, in a SaaS use case, various partition-level resource groups can refer to domain-level resource group templates; while in a PaaS use case, partition-level resource groups can be created that do not refer to resource group templates, but instead represent applications and their related resources that are to be made available within that partition only.

In accordance with an embodiment, resource grouping can be used to group together applications and the resources they use as a distinct administrative unit within the domain. For example, in the medical records (MedRec) application described below, a resource grouping defines the MedRec application and its resources. Multiple partitions can run the same MedRec resource group, each using a partition-specific configuration information, such that the applications that are part of each MedRec instance are made specific to each partition.

Resource Group Templates

In accordance with an embodiment, a resource group template is a collection of deployable resources that are defined at a domain level, that can be referenced from a resource group, and some of the information required to activate its resources may not be stored as part of the template itself, such that it supports the specification of partition level configuration. A domain can contain any number of resource group templates, each of which can include, for example, one or more related Java™ applications and the resources on which those applications depend. Some of the information about such resources may be the same across all partitions, while other information may vary from one partition to the next. Not all configuration need be specified at the domain level—partition level configuration can instead be specified in the resource group template through the use of macros, or property name/value pairs.

In accordance with an embodiment, a particular resource group template can be referenced by one or more resource groups. Generally, within any given partition, a resource group template can be referenced by one resource group at a time, i.e., not simultaneously by multiple resource groups within the same partition; however, it can be referenced at the same time by another resource group in a different partition. The object containing the resource group, e.g., the domain or partition, can use property name/value assignments to set the value of any tokens in the resource group template. When the system activates a resource group template using a referencing resource group, it can replace those tokens with values set in the resource group's containing object. In some cases, the system can also use statically-configured resource group templates and partitions to generate runtime configuration for each partition/template combination.

For example, in a SaaS use case, the system can activate the same applications and resources multiple times, including once for each partition that will use them. When an administrator defines a resource group template they can use tokens to represent the information that will be supplied elsewhere. For example, the username to use in connecting to a CRM-related data resource can be indicated in the resource group template as \${CRMDataUsername}.

Tenants

In accordance with an embodiment, in a multi-tenant environment, such as a multi-tenant (MT) application server environment, a tenant is an entity that can be represented by, or otherwise associated with, one or more partitions and/or one or more tenant-aware applications.

For example, tenants can represent distinct user organizations, such as different external companies, or different departments within a particular enterprise (e.g., HR and Finance departments), each of which can be associated with a different partition. A tenant globally unique identity (tenant ID) is the association of a particular user, at a particular moment in time, with a particular tenant. The system can derive which tenant a particular user belongs to from the user identity, for example by referring to a user identity store. The user identity enables the system to enforce those actions that a user is authorized to perform, including, but not limited to, which tenant the user may belong.

In accordance with an embodiment, the system enables isolation of the administration and runtime of different tenants from each other. For example, tenants can configure some behaviors of their applications, and resources to which they have access. The system can ensure that a particular tenant cannot administer artifacts belonging to another tenant; and, at runtime, that the applications working on behalf of a particular tenant refer only to resources associated with that tenant, and not to resources associated with other tenants.

In accordance with an embodiment, a tenant-unaware application is one that contains no logic dealing with tenants explicitly, such that any resources that the application uses may be accessible regardless of what user submitted a request to which the application is responding. In contrast, a tenant-aware application includes logic that explicitly deals with tenants. For example, based on a user's identity the application can derive the tenant to which the user belongs and use that information to access tenant-specific resources.

In accordance with an embodiment, the system enables users to deploy applications that are explicitly written to be tenant-aware, so that application developers can obtain the tenant ID of a current tenant. The tenant-aware application can then use the tenant ID to handle multiple tenants that are using a single instance of the application. In an embodiment, the system can also enable tenant-unaware applications.

For example, the MedRec application, which supports a single doctor's office or hospital, can be exposed to two different partitions or tenants, e.g., a Bayland Urgent Care tenant, and a Valley Health tenant, each of which is able to access separate tenant-specific resources, such as separate PDBs, without changing the underlying application code.

Exemplary Domain Configuration and Multi-Tenant Environment

In accordance with an embodiment, applications can be deployed to a resource group template at the domain level, or to a resource group that is scoped to a partition or scoped to the domain. Application configuration can be overridden using deployment plans specified per-application, or per-partition. Deployment plans can also be specified as part of a resource group.

FIG. 4 illustrates a domain configuration for use with an exemplary multi-tenant environment, in accordance with an embodiment.

In accordance with an embodiment, when the system starts a partition, it creates virtual targets (e.g., virtual hosts) and connection pools, including one for each partition, to respective database instances, according to the provided configuration.

Typically, each resource group template can include one or more related applications and the resources on which those applications depend. Each partition can provide configuration data that is not specified in the resource group templates to which it refers, by providing a binding of the deployable resources in resource group templates to specific values associated with the partition; including, in some cases, overriding certain configuration information specified by the resource group template. This enables the system to activate an application represented by a resource group template differently for each partition, using the property values each partition has defined.

In some instances, a partition may contain resource groups that do not refer to resource group templates, or that directly define their own partition-scoped deployable resources. Applications and data sources that are defined within a partition are generally available only to that partition. Resources can be deployed so that they can be accessed from across partitions using partition:<partitionName>/<resource JNDI name>, or domain:<resource JNDI name>.

For example, a MedRec application can include a plurality of Java™ applications, a data source, a JMS server, and a mail session. To run the MedRec application for multiple tenants, the system administrator can define a single MedRec resource group template 286, declaring those deployable resources in the template.

In contrast to domain-level deployable resources, the deployable resources declared in a resource group template may not be fully configured in the template, or cannot be activated as-is, since they lack some configuration information.

For example, the MedRec resource group template may declare a data source used by the applications, but it may not specify a URL for connecting to the database. Partitions associated with different tenants, for example, partition BUC-A 290 (Bayland Urgent Care, BUC) and partition VH-A 292 (Valley Health, VH) can reference one or more resource group templates, by each including a MedRec resource group 293, 294 that references 296, 297 the MedRec resource group template. The reference can then be used to create 302, 306, the virtual targets/virtual hosts for each tenant, including a virtual host baylandurgentcare.com 304 associated with the BUC-A partition, for use by the Bayland Urgent Care tenant; and a virtual host valleyhealth.com 308 associated with the VH-A partition, for use by the Valley Health tenant.

FIG. 5 further illustrates an exemplary multi-tenant environment, in accordance with an embodiment. As illustrated in FIG. 5, and continuing the example from above, in which two partitions reference the MedRec resource group template, in accordance with an embodiment, a servlet engine 310 can be used to support a plurality of tenant environments, in this example a Bayland Urgent Care Physician tenant environment 320, and a Valley Health Physician tenant environment 330.

In accordance with an embodiment, each partition 321, 331 can define a different virtual target on which to accept incoming traffic for that tenant environment, and a different URL 322, 332 for connecting to the partition and to its resources 324, 334, including in this example either a bayland urgent care database, or a valley health database respectively. The database instances can use compatible schemas, since the same application code will execute against both databases. When the system starts the partitions, it can create the virtual targets and connection pools to the respective database instances.

In an embodiment, the present disclosure realizes a shared tenant runtime by allowing a single application, for example a Java™ EE application or a legacy Java™ EE application, instance to serve multiple tenants. Additionally, the present disclosure also provides for the support of tenant scoped runtimes in order to support tenant specific customizations (for example, customizations of applications) by allowing separate instantiation of tenant specific customizations to application logic. The shared application instance accesses external resources through the use of resource proxies. The resource proxies can be configured by the deployer to communicate with a shared resource or a tenant specific resource. The use of resource proxies is transparent to the shared application instance.

In accordance with an embodiment, in situations where inter-tenant isolation is desired, the present disclosure also allows for a SaaS provider to instantiate an entire application separately for a tenant and configure the application to use tenant specific resources directly. Importantly, in addition to being able to provide a single application in a shared tenant runtime based upon application tenancy context and resource proxies within a standard environment (i.e., a non-multi-tenant environment), the disclosure herein also allows for providing shared tenant runtime based upon application tenancy context and resources proxies within a multi-tenant environment in which partitions are established and associated with various tenants for runtime definition. This flexibility is achieved, in part, because resource proxies can take advantage of commonly available isolation semantics typically found in application servers (e.g., Java™ EE application servers) as well as taking advantage of special multi-tenancy features (e.g., partitioning).

In accordance with an embodiment, a shared Java™ EE application instance uses resource proxies to access external resources when needed. Resource proxies can use the application tenancy context of the thread to communicate with a tenant specific resource. Resources can be configured, managed, and monitored on a per-tenant basis. Resource proxies can work for a variety of resources, including, but not limited to, JMS, JDBC, Web Services, etc. It can allow underlying resource to participate in XA transactions and in case of server failure, the transaction recovery can happen using the existing recovery mechanism built into every compliant Java™ EE application server.

In an embodiment of the present disclosure, a method and system for deployment of a multi-tenant application are provided. The system and method can, in an embodiment, provide, at one or more computers, including an application server environment executing thereon, a plurality of deployable resources which can be used within the application server environment, and one or more application deployments, wherein each application deployment includes at least one of tenant-specific code and shared-tenant code. The system and method can further determine an application tenancy context of a thread. The method and system can additionally point to one or more resource proxies, each of the one or more resource proxies being configurable to communicate with a tenant specific resource. Each of the one or more resource proxies can use the application tenancy context of a thread to communicate with a tenant specific resource.

FIG. 6 illustrates a system capable of supporting partition-unaware and partition-aware components, in accordance with an embodiment.

As illustrated in FIG. 6, in accordance with an embodiment, the environment can include physical computer resources, for example, CPU, physical memory, and network components 340, a multi-tenant application server (e.g. WLS-MT) partition implementation 342, and one or more partition-unaware application server components 344, and/or partition-aware application server components 346. A traditional, e.g., Java™ application 350 may include only partition-unaware components, in this example a servlet container component 352, and an EJB component 354. A partition-aware Java™ application 360 can include both partition-unaware components, and also partition-aware component, including in this example JNDI 362, config 364, security 366, networking 368, data 370, application container 372 or diagnostic 374 components.

Use of Resource Proxies and Application Tenancy Context

In accordance with an embodiment, a system and method for multi-tenancy enablement of enterprise Java™ applications using resource proxies and application tenancy context is provided.

In accordance with an embodiment, the following terms can be used when describing or explaining methods and systems for multi-tenancy enablement of enterprise Java™ applications using resource proxies and application tenancy.

The term tenancy, in the context of an MT system, means the right to use such a system that belongs to another entity, in accordance with an embodiment. Tenancy can be obtained for a limited duration by a tenant and it allows a tenant to customize a behavior of the system to a certain extent to suit the tenant's needs.

In an embodiment, the term tenant means a user, users, or one who obtains to right to use certain structures, software, modules and runtime within a multi-tenant system. Additionally, the term tenant can also mean a user, users, or one who obtains to right to use certain structures, software, modules and runtime within a vanilla multi-tenant system, that is, a WLS domain that allows multiple tenants but does not strictly partition off the domain into for multiple tenants.

In accordance with an embodiment, the terms system provider, system owner, or system vendor means one who hosts the system for use by tenants. In turn, the terms system provider, system owner, or system vendor is, in an embodiment, further defined by one who grants the right to tenants.

In accordance with an embodiment, the term single-tenant system means a system where only one tenant is able to obtain the right to utilize the system.

In accordance with an embodiment, the term multi-tenant system means a system where more than one tenant is able to obtain the rights to utilize the system.

In accordance with an embodiment, the term tenancy context means contextual information that is used to determine the tenancy of a system. For example, there are many different types of information that make up the context of execution of a system, e.g., security, transaction, location (as in which, e.g., data center, building, host, partition), naming, class loading, etc. to mention a few. The system uses some of these contextual information to determine the tenancy of the system. A system can use tenancy context to provide tenant specific behavior, generate bills, etc.

In accordance with an embodiment, the term application tenancy means the right to use an application as determined by the application software.

In accordance with an embodiment, the term domain code (e.g., multi-tenant (“MT”) admin code) means code and/or software that is deployed and activated before any tenant is on-boarded for a multi-tenant system. Domain code can be responsible for lifecycle management of the system as well as tenant runtimes.

Organization in Multi-Tenant Software

In accordance with an embodiment, a product or service is said to be multi-tenant when a single instance of the product or service can support more than one tenant or customer-organization. A multi-tenant software product's lifecycle and organization is therefore different from a single-tenant software product in that, for example, the multi-tenant instance's life cycle is greater than any tenant's life cycle. For example, within a multi-tenant context, the multi-tenant software product instance is running when there is no tenant on-boarded, and even before there is a tenant to be on-boarded. Conversely, a single-tenant software product instance's lifecycle is tied directly to the tenant that it supports. So, a single tenant software instance typically would not be running before the tenant is available.

Domain Code

In accordance with an embodiment, a multi-tenant software product can have clearly demarcated code which can be separately deployed and activated before any tenant is on-boarded (i.e., domain code). When executed, the runtime representation of the domain code is the domain runtime.

In accordance with an embodiment, the domain code can be responsible for bootstrapping the entire MT product instance. The domain code can also handle the on-boarding of tenants (e.g., when tenants are incorporated into the domain code). The domain code also manages the tenant life cycle management, as well as various system level administration activities of the MT product instance.

In an embodiment, domain code can be present even in a single-tenant software. For example, a state managed by the domain code includes global application metadata about the product, information about tenants including details about their runtimes.

Tenant Code

In accordance with an embodiment, other code in the product, which serves to provide a tenant-specific view of the software, is referred to as tenant code. The runtime associated with the portion of the software code referred to as tenant code is correspondingly referred to as tenant runtime.

In an embodiment of the present disclosure the domain runtime sets up tenant runtime for new tenants that are on-boarded in the MT product. Each tenant runtime has its own tenant state which is a combination of tenant-specific transient and persistent state. Tenant state includes customized application metadata and configuration for the tenant, transactional data belonging to a tenant.

Shared Tenant Code

In accordance with an embodiment, in situations where the tenant code is not realized in runtime for each tenant separately (e.g., the tenant code is too large to be realized in runtime for every tenant separately), parts of the tenant code can be shared. For example, in situations where each new tenant on-boarded into an MT system requires a large amount of tenant code, then this large tenant code has to be replicated for every new tenant runtime created for the new tenant. This is neither cost nor resource effective. Thus, in such situations, the system may make use of shared tenant code.

Additionally, in accordance with an embodiment, MT systems can attempt to maximize sharing in order to reduce cost and increase efficiency. In such situations, a typical MT product would ensure that most (if not all) tenant runtimes are designed to have similar characteristics (e.g., same libraries, code and metadata).

Thus, in accordance with an embodiment, an MT product can break up the tenant code into at least two parts. A first portion of the code is shared among multiple tenants. As already indicated, this portion of the code is referred to as shared tenant code. A second portion of the code remains specific to each tenant. Again, as already mentioned, this portion of the code is referred to as tenant code. Once allotted to a tenant, the tenant code is said to be tenant scoped (e.g., tenant scoped runtime).

In accordance with an embodiment, a runtime representation of the parts of the tenant code that are shared among the tenants (i.e., the shared tenant code) is called the shared tenant runtime. The runtime representation of the tenant code that exists solely for a tenant is called the tenant runtime.

In accordance with an embodiment, the shared tenant runtime is able to access all the tenant states in the system. To serve any particular tenant, the shared tenant runtime can select the appropriate tenant state while serving the tenant. In order to do so, the shared tenant runtime can identify the tenant for which the current request is being processed. In other words, the shared tenant code in a shared tenant runtime can be tenant-aware. In order to provide security to different tenants that share tenant code in a shared tenant runtime, protections can be built into the shared tenant code so as to avoid storing tenant specific details in variables that are accessible to multiple tenants.

In accordance with an embodiment, shared tenant code represents code that is shared across tenants. Additionally, there is a subset of the shared tenant code that can include static libraries, with the static libraries being tenant-unaware.

In an embodiment, the tenant code is tenant-unaware. In such a situation, the tenant code is realized in a separate runtime for each tenant, respectively. This provides the benefit of keeping the tenant code simple, but, at the same time, increases the cost of runtime/infrastructure efficiency. The domain runtime ensures that the tenant runtime gets its own copy of the code, e.g., isolated configuration, runtime. Existing single-tenant application code are likely to have been written this way (e.g., tenant-unaware), since the code did not have to be written with concern for more than one tenant.

In accordance with an embodiment, when the shared tenant code and shared tenant runtime concept is supported in a product, then some existing tenant code (that is, code that is tenant-unaware) can be made to be tenant-aware. In such situations, the existing tenant code can further be made to form a portion of the shared tenant code and, additionally, share the shared tenant runtime. This is not to say that the entirety of the tenant code must be made tenant unaware. For example, a portion of the tenant code can remain tenant-unaware and run as part of separate tenant runtimes.

In accordance with an embodiment, the domain runtime manages the lifecycle of the shared tenant runtime (like it does with the tenant runtimes). A shared tenant runtime is instantiated at least prior to the first access from any tenant runtime that refers to it.

In an embodiment, both the shared tenant runtime and the tenant runtime are invoked in the context of a tenant. Conversely, domain runtime may or may not be invoked in the context of a tenant. Domain runtime can, unlike tenant runtime and shared tenant runtime, be called in the context of no-tenant, and, depending on the semantics of the operation being performed, it can operate on one or more tenant specific persistent states or invoke one or more tenant runtimes.

In an embodiment, within an optimized environment, there may be overlap between shared tenant runtime and domain runtime. This overlap is usually achieved via use of common classes or using common Java™ EE components.

For example, referring now to FIG. 7A, which depicts a runtime environment, according to an embodiment. In FIG. 7A, runtime environment 700A includes a multi-tenant (MT) admin runtime 701, as well as tenant 1 runtime 702 and tenant 2 runtime 703. In the depicted embodiment, tenant 1 and tenant 2 do not share runtime within a shared tenant runtime, but are instead each given a separate tenant runtime, respectively. Additionally, each tenant code is tenant unaware. This separate tenant runtime is administered by the domain runtime, which ensures that both tenant 1 and tenant 2 received their own copy of the code. By having the domain runtime administer the respective code to the tenants within the runtime environment 700A, this allows for increases in efficiency of runtime and infrastructure. However, in such situations, because a copy of the code must be distributed to each tenant within the runtime environment 700A, e.g., tenant 1 and tenant 2, the code is desired to be relatively simple.

As another example, referring now to FIG. 7B, which depicts a runtime environment, according to an embodiment. In FIG. 7B, runtime environment 700B includes a multi-tenant (MT) admin runtime 701, as well shared tenant runtime 704. In the depicted embodiment, each tenant that has been on-boarded into the runtime environment 700B participates with the shared tenant runtime 704. Additionally, in the embodiment shown, no tenant has any tenant runtime as all runtime for each tenant takes place in the shared tenant runtime. The shared tenant runtime 704 is able to access all the tenant states in the system, irrespective of the number of tenants in the environment. To serve any particular tenant, the shared tenant runtime 704 is able to select the appropriate tenant state while serving the tenant. To do so, the shared tenant runtime can identify the tenant for which the current request is being processed. Thus, the shared tenant code within the shared tenant runtime is tenant-aware. In order to provide security to different tenants that share tenant code in a shared tenant runtime, protections can be built into the shared tenant code so as to avoid storing tenant specific details in variables that are accessible to multiple tenants

Referring now to FIG. 7C, which depicts a runtime environment, according to an embodiment. In FIG. 7C, runtime environment 700C includes multi-tenant (MT) admin runtime 701, shared tenant runtime 704, tenant 1 scoped runtime 705 and tenant 2 scoped runtime 706. In this embodiment, the domain runtime 701 has broken up the runtimes (as well as the respective codes) into both shared tenant runtime 704, and into two scoped runtimes, one for each tenant, e.g., tenant 1 and tenant 2. In this embodiment, both tenant 1 and tenant 2 have runtimes that are shared between each other, the shared tenant runtime (e.g., tenant aware) 704, as well as their own runtimes, that is the tenant scoped runtimes (e.g., tenant unaware) 705 and 706, respectively. In this manner, the runtime environment can take advantage of the efficiencies that come with the shared tenant runtime 704, as well as maintaining individual tenant runtimes (i.e., the scoped runtimes).

It should be understood that in the embodiments depicted in FIGS. 7A-7C are merely illustrative, and there should be no implied limitation as to the number of tenants participating in the runtime environments.

Application Tenancy Context

In accordance with an embodiment, it may be cost and/or resource prohibitive if every layer of an application is modified or engineered to become tenant aware (i.e., having shared tenant code and/or shared tenant runtime). Because of this, a few layers of the application can be made tenant-aware, and use application tenancy in those layers. At runtime, different slices of the application are made available for different tenants. When a resource is being accessed (irrespective of the resource being present in the tenant scoped runtime or in the shared tenant runtime), the application tenancy context can be set to the current application tenant on behalf of whom the resource is being accessed. In accordance with an embodiment, an exemplary API to establish and retrieve application tenancy is described below:

package weblogic.application.mt; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; /** *  The application tenant on whose context a request is being executed is *  represented as the application tenancy context of the request. This class is *  used to query as well as change tenancy context. The static #getCurrentTenant *  method returns the current application tenancy context. The static #executeAs *  method allows privileged code to switch the application tenancy context *  before executing some code. To be specific, it only allows switching from *  GLOBAL tenancy context to a specific tenant's context. */ public abstract class ApplicationTenancyContext { /** *   Represent ID of the administrative tenant which exists to carry out actions *   on behalf of all tenants. */ public final String GLOBAL_TENANT_ID = “GLOBAL”; /** *   Controls whether the effect of setting application tenancy will be *   visible locally (in current thread) or in remote components as well. */ public enum PropagationMode { /** *    Only propagated along the current thread */ LOCAL, /** *    Propagates to remote as well as local components */ ALL } /** *   Returns the ID of the application tenant on whose behalf the current *   request is being made. If application tenancy context has not been *   explicitly set, then this method determines the application tenancy context *   from platform tenancy context using a partition-to-tenant mapping API. *   DOMAIN partition is mapped to #GLOBAL_TENANT_ID. A value of null is *   different from #GLOBAL_TENANT_ID. * *   @return the application tenant ID */ public static String getCurrentTenant( ); /** *   Execute the supplied code after switching the application tenancy context *   to that of the tenant identified by tenantId argument. It restores the *   application tenancy context to its original value before returning. Using *   propagationMode argument, caller can decide whether the tenancy context *   should be propagated to remote components as well as local components or *   local components only. If the supplied action throws any exception, then *   that's wrapped in an ExecutionException instance and thrown back. * *   If a security manager exists and   then its {@link *   SecurityManager#checkPermission *   checkPermission} method is called with a <code>{@link *   RuntimePermission}(“executeAs.”+tenantId)</code> permission.    This may *   result in a {@link SecurityException} being thrown. Callers can be granted *   privileges using wild card. This security check is performed even when *   tenantId is same as value returned by #getCurrentTenant. * *   @param tenantId ID of the application tenant whose tenancy context * is being set *   @param propagationMode flag to control how tenancy context will be * propagated *   @param action The action to be performed *   @return an action specific value or null if it's a void action. *   @throws ExecutionException when the supplied action aborts by throwing * any exception. Use #getCause to see the * underlying exception. *   @throws NullPointerException if either tenantId or action is null *   @throws SecurityException if a security manager exists and its {@link * SecurityManager#checkPermission * checkPermission} method denies access to this * method. *   @throws IllegalStateException if the application tenancy context can't be * switched to the requested value from the * current value as described earlier. */ public static <T> T executeAs(String tenantId, PropagationMode propagationMode, Callable<T> action) throws ExecutionException; } Resource Proxies

In accordance with an embodiment, shared tenant code and domain code do not have a fixed binding to a particular tenant's resource. Instead, the shared tenant code and domain code can select a tenant specific resource based on the operational context. Since the code desires a fixed reference to a resource, and because not all tenant resources can be pre-provisioned in the system, a resource proxy can be used in order to allow the shared tenant code and domain code to have a “fixed” binding to a tenant's resource (e.g., tenant specific resources), where the resource proxy represents a fixed location that can be populated with tenant specific resources.

For example, in an embodiment, shared tenant code and domain code can have a fixed Java™ Naming and Directory Interface (JNDI) reference to a resource proxy. In turn, the resource proxy selects a particular underlying resource based upon the current tenant context (as determined through, for example, the API described above).

In accordance with an embodiment, a resource proxy can be implemented using the following technique:

A javax.naming.Reference of name given by “jndi-name” is bound in JNDI. Each reference is configured with an “object-type,” a “factory-class” and a custom property called “jndi-callback-class-name.” This custom property is configured using “Reference.add(RefAddr)” method. The “object-type” determines the type of the resource being accessed, e.g., javax.sql.DataSource. When “jndi-name” look up is made using JNDI API such as javax.naming.Context.lookup(String), JNDI subsystem instantiates the factory-class registered against the jndi-name. The “factory-class” is a subclass of javax.naming.spi.ObjectFactory. JNDI subsystem calls getObjectInstance( ) method of the factory to locate the actual object and return to the caller. A generic factory-class using Java's dynamic proxy utility is further implemented. The getObjectInstance( ) method of the “factory-class” creates a dynamic proxy instance of type “object-type” using java.lang.reflect.Proxy.newProxyInstance( ). Each dynamic proxy instance is associated with a JNDIProxy object, which implements java.lang.reflectInvocationHandler and intercepts every method called using the dynamic proxy instance. JNDIProxy reflectively loads and instantiates the class configured via “jndi-callback-class-name” property in the Reference object. It expects the class to be of type JNDISwitchingCallback which has a method with signature:

Object getObject(String hostResourceName).

In accordance with an embodiment, JNDIProxy delegates the calls to the result of getObject method. Alternatively, JNDIProxy class can also be coded to use Java's native service discovery mechanism (java.util.ServiceLoader) to look for a service of type “JNDISwitchingCallback.class.”

The resource proxy technique described herein is available for a variety of resource types such as Java™ Database Connectivity (JDBC), Java™ Message Service (JMS) (both inbound and outbound), Web Services References, Java™ EE Connector resources, JSR 236 Services, etc. Additionally, the resource proxy described herein also is available in both Java™ SE and Java™ EE environment.

Support Multi-Tenant Inbound Message Delivery to MDBs

Provided herein is an example, according to an embodiment, of the above description relating to an application server automatically providing a tenant specific resource for outbound communication, based on the operational context of the current request to an application component residing in shared tenant code and domain code. In the case of an inbound JMS message delivery to Message Driven Beans (MDBs), a JMS resource adapter (RA) can be modified as follows: A JMS resource adapter typically performs delivery to JMS MDBs through either of the following two ways:

In a first technique, it can use the standard interfaces for “Concurrent Processing of a Subscription's Messages” (i.e., ServerSession, ServerSessionPool and ConnectionConsumer) that may be optionally implemented by application servers. In a second technique, it may use a synchronous consume on the JMS MessageConsumer.

Each MDB activation can provide information on how a resource adapter can retrieve the messages to deliver to the MDB. In the case of a MDB deployed to a shared tenant or domain runtime, the destinationLookup and connectionFactoryLookup is configured to point to the corresponding resourceProxy JNDI references. If a resource adapter uses the first technique described above, then the resource adapter can create a ConnectionConsumer for every application tenant, for example as shown in this pseudo-code:

for (Tenant t: tenants) { conConsumer = topicCon.createConnectionConsumer(topicDestinationOfTenantT, selectorOfMDB, serverSessionPoolForTenantT, maxMessages); }

By providing a custom ServerSession pool per Tenant, the resource adapter can then associate an incoming message delivery to a particular application tenant. In the ServerSession's MessageListener implementation, prior to delivery of the message to the message endpoint, the resource adapter must establish the Application Tenancy Context using the ApplicationTenancyContext.executeAs( . . . ) API discussed above, so that the delivery of the JMS message to the MDB happens in the context of the application tenant.

If the resource adapter uses the second technique as described above, the resource adapter can create a MessageConsumer per application tenant to the tenant's Destination, and establish the application tenancy context prior to message delivery.

Multi-Tenant Java EE Application within a Non-Multi-Tenancy Environment

Referring now to FIG. 8, which depicts a runtime view of a server where a multi-tenant application has been deployed, according to an embodiment. FIG. 8 depicts an application server environment 800 within which a domain 810 contains the various runtime application deployments for both tenant 1 and tenant 2. In the presented example, both tenant 1 application deployment 830 and tenant 2 application deployment 840 access the tenant 1 pluggable database 860 as well as tenant 2 pluggable database 870, respectively, via the resource proxy 820. Both tenant 1 application deployment 830 and tenant 2 application deployment 840 can contain tenant specific code as well as shared tenant code. In turn, the resource proxy 820 uses the tenancy context 890 (as discussed above) to determine which resource, either tenant 1 resource 835 or tenant 2 resource 845, to point to.

In accordance with an embodiment, both application deployments 830 and 840 point to the same resource proxy 820, the application tenancy context 890 determined by the system allows the application to access the right database, for example, either tenant 1 PDB 860 or tenant 2 PDB 870, depending on the application tenancy context 890.

Additionally, before selecting either tenant 1 or tenant 2 with respect to the application tenancy context, both application deployments may point to a global PDB 880, in accordance with an embodiment. This occurs, for example, before either tenant 1 or tenant 2 has been on-boarded into the system, but while both application deployments are running. In such situations, the resource proxy points to the global resource 855, and in turn the application deployments can access the global PDB 880. In turn, the system may return the application deployments to accessing the global PDB 880 if the application tenancy context so determines during or after runtime. Importantly, the application server environment 800 depicted in FIG. 8, takes advantage of commonly available isolation semantics typically found in application servers (e.g., Java EE application servers) in order to keep the runtimes of tenant 1 and tenant 2 separate, if desired.

In an embodiment tenant 1 application deployment 830 and tenant 2 application deployment 840 can represent either tenant code or shared tenant code, as well as the corresponding tenant runtimes and shared tenant runtimes. For example, in looking at FIG. 7C, tenant 1 application deployment 830 and tenant 2 application deployment 840 can represent both the separate tenant 1 and tenant 2 scoped runtimes, as well as, in certain embodiments, shared tenant runtime.

For example, in an embodiment, FIG. 8 represents an Oracle™ WebLogic Server environment where a multi-tenant Java™ EE application has been deployed. In the embodiment depicted by FIG. 8, the Java™ EE runtime access the databases via the resource proxy, which in turn knows which underlying datasource to use based on application tenancy context. The multi-tenant Java™ EE application (or a legacy Java™ EE application), can additionally provide for the support of tenant scoped runtimes in order to support tenant specific customizations (for example, customizations of applications based upon the tenant databases) by allowing separate instantiation of tenant specific customizations to application logic.

Multi-Tenant Java EE Application within a Multi-Tenancy Environment

Referring now to FIG. 9, which depicts a runtime view of a server where a multi-tenant application has been deployed, according to an embodiment. FIG. 9 depicts a processing environment within which a multi-tenant application server domain 910 contains the various runtime application deployments for both tenant 1 and tenant 2, as well as a global application. Multi-tenant application server environment 910 includes, in an embodiment, domain 905, which includes tenant 1 partition 906, and tenant 2 partition 907. Domain 905 also includes global application 985 (or at least a portion of the multi-tenant application that is global), resource proxy 920, and global resource 955, which in turn points to global pluggable database (PDB) 980. Tenant 1 partition 906 includes the tenant 1 application deployment 930 as well as tenant 1 resource 935, which in turn points to tenant 1 pluggable database 960. Tenant 2 partition 907 includes the tenant 2 application deployment 940 as well as tenant 1 resource 945, which in turn points to tenant 2 pluggable database 970.

In the depicted embodiment, before any tenants are on-boarded, a multi-tenant application, or at least a portion thereof, is running within the domain 905. In such a situation, the global application 985 (which can include, for example, domain code and shared tenant code) accesses the global PDB 980 via the resource proxy 920. The resource proxy 920, in turn, knows to point to the global resource 955 based upon the application tenancy context 990, which, without any tenants on-boarded, tells the proxy to point to the global resource 955, and in turn the global PDB 980. This, for example, relates to domain runtime, where no tenants have been on-boarded.

In an embodiment, after tenants are on-boarded, e.g., tenant 1 and tenant 2, the application tenancy context 990 changes. In such a situation, the multi-tenant application deployments for tenants 1 and 2 (which can include, for example, tenant specific code as well as shared tenant code), 930 and 940 respectively, access tenant 1's PDB 960 and tenant 2's PDB 970 via resource proxy 920. The resource proxy 920, in turn, knows to point to the tenant 1 resource 935 and tenant 2 resource 945 based upon the application tenancy context 990. These tenant resources in turn allow the multi-tenant application to access tenant 1 PDB 960 and tenant 2 PDB 970. Importantly, the processing environment depicted in FIG. 9 takes advantage of a multi-tenancy environment which also allows for providing shared tenant runtime based upon application tenancy context and resources proxies within a multi-tenant environment in which partitions are established and associated with various tenants for runtime definition.

For example, in an embodiment, FIG. 9 represents an Oracle™ WebLogic Server environment where a multi-tenant Java™ EE application has been deployed. In the embodiment depicted by FIG. 9, the Java™ EE runtime access the various databases via the resource proxy, which in turn knows which underlying datasource to use based on application tenancy context. The multi-tenant Java™ EE application can additionally provide for the support of tenant scoped runtimes in order to support tenant specific customizations (for example, customizations of applications based upon the tenant databases) by allowing separate instantiation of tenant specific customizations to application logic.

FIG. 10 illustrates an exemplary flow chart for an exemplary method 1000 for deployment of a multi-tenant application. At step 1001, the method can begin with providing, at one or more computers, including an application server environment executing thereon, a plurality of deployable resources which can be used within the application server environment, and one or more application deployments, wherein each application deployment includes at least one of tenant-specific code and shared-tenant code. The exemplary method 1000 can continue at step 1002 with determining an application tenancy context of a thread. The exemplary method 1000 can proceed with pointing to one or more resource proxies, each of the one or more resource proxies being configurable to communicate with at least one tenant specific resource. The exemplary method 1000 can further allow for each of the one or more resource proxies to use the application tenancy context of a thread to communicate with the at least one tenant specific resource.

The present invention may be conveniently implemented using one or more conventional general purpose or specialized digital computer, computing device, machine, or microprocessor, including one or more processors, memory and/or computer readable storage media programmed according to the teachings of the present disclosure. Appropriate software coding can readily be prepared by skilled programmers based on the teachings of the present disclosure, as will be apparent to those skilled in the software art.

In some embodiments, the present invention includes a computer program product which is a non-transitory storage medium or computer readable medium (media) having instructions stored thereon/in which can be used to program a computer to perform any of the processes of the present invention. The storage medium can include, but is not limited to, any type of disk including floppy disks, optical discs, DVD, CD-ROMs, microdrive, and magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic or optical cards, nanosystems (including molecular memory ICs), or any type of media or device suitable for storing instructions and/or data.

The foregoing description of the present invention has been provided for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Many modifications and variations will be apparent to the practitioner skilled in the art. The embodiments were chosen and described in order to best explain the principles of the invention and its practical application, thereby enabling others skilled in the art to understand the invention for various embodiments and with various modifications that are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the following claims and their equivalents. 

What is claimed is:
 1. A method for deployment of an application, comprising: providing, at one or more computers, including an application server that enables deployment and execution of software applications, wherein the application server is associated with a domain configuration that is used at runtime to define a domain for execution of the software applications, a plurality of deployable resources defined within the application server, and a plurality of application deployments, each application deployment being associated with a different tenant of a plurality of tenants, wherein an application deployment of the plurality of application deployments is deployed in the context of a tenant of the plurality of tenants and is associated with at least one tenant specific resource of a plurality of tenant specific resources; running the application deployment of the plurality of application deployments on a thread within the application server, wherein the application deployment communicates with a resource proxy, the resource proxy being bound at a fixed location within the domain; and determining an application tenancy context of the thread, the determined application tenancy context providing an indication of the tenant based upon the at least one tenant specific resource associated with the running application deployment; selecting, by the resource proxy, based upon the determined application tenancy context of the thread, a tenant specific resource of the plurality of tenant specific resources, and, on behalf of the running application deployment, communicating with the selected tenant specific resource of the plurality of tenant specific resources.
 2. The method of claim 1, wherein the resource proxy, based upon the determined application tenancy context of the thread, further selects a shared tenant resource to communicate with on behalf of the running application deployment.
 3. The method of claim 1, wherein the application server comprises a multi-tenant application server domain.
 4. The method of claim 3, wherein one or more partitions are provided, and wherein each of the plurality of application deployments comprises an administrative subdivision and a runtime subdivision of the domain for use by a tenant.
 5. The method of claim 4, wherein the runtime subdivision of each application deployment comprises at least one of shared-tenant runtime, tenant scoped runtime, and administrative runtime.
 6. The method of claim 3, wherein each of the plurality of application deployments further includes administrative code.
 7. The method of claim 1, wherein the determining the application tenancy context of a thread is based on at least a current application tenant.
 8. A system for deployment of an application, comprising: one or more computers, including an application server that enables deployment and execution of software applications, wherein the application server is associated with a domain configuration that is used at runtime to define a domain for execution of the software applications; a plurality of deployable resources defined within the application server; and a plurality of application deployments, each application deployment being associated with a different tenant of a plurality of tenants, wherein an application deployment of the plurality of application deployments is deployed in the context of a tenant of a plurality of tenants and is associated with at least one tenant specific resource of a plurality of tenant specific resources; wherein the application deployment of the plurality of application deployments is run on a thread within the application server, wherein the application deployment communicates with a resource proxy, the resource proxy being bound at a fixed location within the domain; and wherein the system determines an application tenancy context of the thread, the determined application tenancy context providing an indication of the tenant based upon the at least one tenant specific resource associated with the running application deployment; and wherein the resource proxy, based upon the determined application tenancy context of the thread, selects a tenant specific resource of the plurality of tenant specific resources, and, on behalf of the running application deployment, communicates with the selected tenant specific resource of the plurality of tenant specific resources.
 9. The system of claim 8, wherein the resource proxy, based upon the determined application tenancy context of the thread, further selects a shared tenant resource to communicate with on behalf of the running application deployment.
 10. The system of claim 8, wherein the application server comprises a multi-tenant application server domain.
 11. The system of claim 10, wherein one or more partitions are provided, and wherein each of the plurality of application deployments comprise an administrative subdivision and a runtime subdivision of the domain for use by a tenant.
 12. The system of claim 11, wherein the runtime subdivision of each application deployment comprises at least one of shared-tenant runtime, tenant scoped runtime, and administrative runtime.
 13. The system of claim 10, wherein each of the plurality of application deployments further includes administrative code.
 14. The system of claim 8, wherein the determining the application tenancy context of a thread is based on at least a current application tenant.
 15. A non-transitory machine readable storage medium having instructions stored there that when executed cause a system to perform the steps comprising: providing, at one or more computers, including an application server that enables deployment and execution of software applications, wherein the application server is associated with a domain configuration that is used at runtime to define a domain for execution of the software applications, a plurality of deployable resources defined within the application server, and a plurality of application deployments, each application deployment being associated with a different tenant of a plurality of tenants, wherein an application deployment of the plurality of application deployments is deployed in the context of a tenant of the plurality of tenants and is associated with at least one tenant specific resource of a plurality of tenant specific resources; running the application deployment of the plurality of application deployments on a thread within the application server, wherein the application deployment communicates with a resource proxy, the resource proxy being bound at a fixed location within the domain; and determining an application tenancy context of the thread, the determined application tenancy context providing an indication of the tenant based upon the at least one tenant specific resource associated with the running application deployment; selecting, by the resource proxy, based upon the determined application tenancy context of the thread, a tenant specific resource of the plurality of tenant specific resources, and, on behalf of the running application deployment, communicating with the selected tenant specific resource of the plurality of tenant specific resources.
 16. The non-transitory machine readable storage medium of claim 15, wherein the resource proxy, based upon the determined application tenancy context of the thread, further selects a shared tenant resource to communicate with on behalf of the running application deployment.
 17. The non-transitory machine readable storage medium of claim 15, wherein the application server comprises a multi-tenant application server domain.
 18. The non-transitory machine readable storage medium of claim 17, wherein one or more partitions are provided and wherein each of the plurality of application deployments comprises an administrative subdivision and a runtime subdivision of the domain for use by a tenant.
 19. The non-transitory machine readable storage medium of claim 18, wherein the runtime subdivision of each application deployment comprises at least one of shared-tenant runtime, tenant scoped runtime, and administrative runtime.
 20. The non-transitory machine readable storage medium of claim 15, wherein the determining the application tenancy context of a thread is based on at least a current application tenant. 